using UnityEngine;

public class Cabin : MonoBehaviour
{
	private Vector2 spriteSize;

	[SerializeField]
	private SpriteRenderer mineral;

	private void Start()
	{
		spriteSize = mineral.size;
	}

	public void Fill(float value)
	{
		value = Mathf.Clamp01(value);
		if (value > 0f && value < 0.2f)
		{
			value = 0.2f;
		}
		mineral.size = new Vector2(spriteSize.x, spriteSize.y * value);
	}
}
